<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>自动填写地址</title>
  <style>
    body {
      font-family: 'Microsoft YaHei', Arial, sans-serif;
      width: 320px;
      margin: 0;
      padding: 15px;
      background-color: #f5f5f5;
    }
    .container {
      background-color: white;
      border-radius: 8px;
      padding: 15px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    h1 {
      color: #4285F4;
      font-size: 18px;
      margin-top: 0;
      margin-bottom: 15px;
      text-align: center;
    }
    .form-group {
      margin-bottom: 12px;
    }
    label {
      display: block;
      margin-bottom: 5px;
      font-size: 14px;
      color: #555;
    }
    input, select, textarea {
      width: 100%;
      padding: 8px;
      border: 1px solid #ddd;
      border-radius: 4px;
      box-sizing: border-box;
      font-size: 14px;
    }
    textarea {
      height: 60px;
      resize: vertical;
    }
    button {
      background-color: #4285F4;
      color: white;
      border: none;
      padding: 10px 15px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
      width: 100%;
      margin-top: 5px;
    }
    button:hover {
      background-color: #3367d6;
    }
    .saved-addresses {
      margin-top: 15px;
    }
    .address-item {
      background-color: #f9f9f9;
      border: 1px solid #eee;
      border-radius: 4px;
      padding: 10px;
      margin-bottom: 8px;
      position: relative;
    }
    .address-item .name {
      font-weight: bold;
      margin-bottom: 5px;
    }
    .address-item .actions {
      position: absolute;
      right: 10px;
      top: 10px;
    }
    .address-item .actions button {
      width: auto;
      padding: 3px 8px;
      margin-left: 5px;
      font-size: 12px;
    }
    .tabs {
      display: flex;
      margin-bottom: 15px;
      border-bottom: 1px solid #ddd;
    }
    .tab {
      padding: 8px 15px;
      cursor: pointer;
      border-bottom: 2px solid transparent;
    }
    .tab.active {
      border-bottom: 2px solid #4285F4;
      color: #4285F4;
    }
    .tab-content {
      display: none;
    }
    .tab-content.active {
      display: block;
    }
    .reset-btn {
      background-color: #ff4d4f;
      margin-top: 15px;
    }
    .reset-btn:hover {
      background-color: #ff7875;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>自动填写地址</h1>
    
    <div class="tabs">
      <div class="tab active" data-tab="add">添加地址</div>
      <div class="tab" data-tab="manage">管理地址</div>
    </div>
    
    <div class="tab-content active" id="add-tab">
      <div class="form-group">
        <label for="address-name">地址名称</label>
        <input type="text" id="address-name" placeholder="如：家、公司等">
      </div>
      
      <div class="form-group">
        <label for="receiver">收件人</label>
        <input type="text" id="receiver" placeholder="收件人姓名">
      </div>
      
      <div class="form-group">
        <label for="phone">联系电话</label>
        <input type="text" id="phone" placeholder="联系电话">
      </div>
      
      <div class="form-group">
        <label for="province">省份</label>
        <!-- <select id="province">
          <option value="">请选择省份</option>
          省份选项将通过JavaScript动态添加 
        </select> -->
         <input type="text" id="province" placeholder="省份">
      </div>
      
      <div class="form-group">
        <label for="city">城市</label>
        <!-- <select id="city" disabled>
          <option value="">请先选择省份</option>
        </select> -->
        <input type="text" id="city" placeholder="城市">
      </div>
      
      <div class="form-group">
        <label for="district">区/县</label>
        <!-- <select id="district" disabled>
          <option value="">请先选择城市</option>
        </select> -->
        <input type="text" id="district" placeholder="区县">
      </div>

       <div class="form-group">
        <label for="street">街道/乡镇</label>
        <!-- <select id="district" disabled>
          <option value="">请先选择区县</option>
        </select> -->
        <input type="text" id="street" placeholder="街道/乡镇">
      </div>
      
      <div class="form-group">
        <label for="detail-address">详细地址</label>
        <textarea id="detail-address" placeholder="街道、门牌号等"></textarea>
      </div>
      
      <div class="form-group">
        <label for="postcode">邮政编码</label>
        <input type="text" id="postcode" placeholder="邮政编码">
      </div>
      
      <button id="save-address">保存地址</button>
      <button id="read-address">读取地址</button>
    </div>
    
    <div class="tab-content" id="manage-tab">
      <div class="saved-addresses" id="address-list">
        <!-- 已保存的地址将通过JavaScript动态添加 -->
      </div>
      <button id="reset-addresses" class="reset-btn">重置为默认测试地址</button>
    </div>
  </div>
  
  <script src="popup.js"></script>
</body>
</html>